package exce1.exce05;

import java.util.Scanner;

public class Exer01 {
    public static void main(String[] args) {
        String str=new String();
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        str=sc.nextLine();//abcdsfg
        int lo = str.length();
        System.out.println(lo);//7
        char[] ch = str.toCharArray();
        for (int j = 0; j < ch.length; j++) {
            System.out.print(ch[j]+" ");
        }
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            System.out.print(c+" ");
        }
        String er = str.replace("s", "s");
        System.out.println(er);//abcdkfg
        String st = str.substring(1);
        System.out.println(st);//bcdsfg
        String sst=str.substring(0,2);
        System.out.println(sst);//ab
        String[] ss1 = str.split("s");
        for (int i = 0; i < ss1.length; i++) {
            System.out.println(ss1[i]);//abcd fg
        }
    }
}
